import { IPSDataEntity } from '../ipsdata-entity';
import { IPSDEAction } from '../action/ipsdeaction';
import { IPSDEDataQuery } from '../ds/ipsdedata-query';
import { IPSDEDataSet } from '../ds/ipsdedata-set';
import { IPSDELogic } from './ipsdelogic';
import { IPSDELogicParam } from './ipsdelogic-param';
import { IPSDEUserLogic } from './ipsdeuser-logic';
import { PSDELogicNodeImpl } from './psdelogic-node-impl';

export class PSDEUserLogicImpl extends PSDELogicNodeImpl implements IPSDEUserLogic {
  protected dstpsdeaction: IPSDEAction | null = null;

  getDstPSDEAction(): IPSDEAction | null {
    if (this.dstpsdeaction != null) return this.dstpsdeaction;
    const value = this.M.getDstPSDEAction;
    if (value == null) {
      return null;
    }
    this.dstpsdeaction = this.getDstPSDataEntityMust().findPSDEAction(value);
    return this.dstpsdeaction;
  }

  get dstPSDEAction(): IPSDEAction | null {
    return this.getDstPSDEAction();
  }

  getDstPSDEActionMust(): IPSDEAction {
    const value = this.getDstPSDEAction();
    if (value == null) {
      throw new Error('未指定目标实体行为对象');
    }
    return value;
  }

  protected dstpsdedataquery: IPSDEDataQuery | null = null;

  getDstPSDEDataQuery(): IPSDEDataQuery | null {
    if (this.dstpsdedataquery != null) return this.dstpsdedataquery;
    const value = this.M.getDstPSDEDataQuery;
    if (value == null) {
      return null;
    }
    this.dstpsdedataquery = this.getDstPSDataEntityMust().findPSDEDataQuery(value);
    return this.dstpsdedataquery;
  }

  get dstPSDEDataQuery(): IPSDEDataQuery | null {
    return this.getDstPSDEDataQuery();
  }

  getDstPSDEDataQueryMust(): IPSDEDataQuery {
    const value = this.getDstPSDEDataQuery();
    if (value == null) {
      throw new Error('未指定目标实体数据查询');
    }
    return value;
  }

  protected dstpsdedataset: IPSDEDataSet | null = null;

  getDstPSDEDataSet(): IPSDEDataSet | null {
    if (this.dstpsdedataset != null) return this.dstpsdedataset;
    const value = this.M.getDstPSDEDataSet;
    if (value == null) {
      return null;
    }
    this.dstpsdedataset = this.getDstPSDataEntityMust().findPSDEDataSet(value);
    return this.dstpsdedataset;
  }

  get dstPSDEDataSet(): IPSDEDataSet | null {
    return this.getDstPSDEDataSet();
  }

  getDstPSDEDataSetMust(): IPSDEDataSet {
    const value = this.getDstPSDEDataSet();
    if (value == null) {
      throw new Error('未指定目标实体数据集对象');
    }
    return value;
  }

  protected dstpsdelogicparam: IPSDELogicParam | null = null;

  getDstPSDELogicParam(): IPSDELogicParam | null {
    if (this.dstpsdelogicparam != null) return this.dstpsdelogicparam;
    const value = this.M.getDstPSDELogicParam;
    if (value == null) {
      return null;
    }
    const ipsdelogic = this.getParentPSModelObject('dataentity.logic.IPSDELogic') as IPSDELogic;
    if (ipsdelogic != null) {
      this.dstpsdelogicparam = ipsdelogic.findPSDELogicParam(value);
    }
    return this.dstpsdelogicparam;
  }

  get dstPSDELogicParam(): IPSDELogicParam | null {
    return this.getDstPSDELogicParam();
  }

  getDstPSDELogicParamMust(): IPSDELogicParam {
    const value = this.getDstPSDELogicParam();
    if (value == null) {
      throw new Error('未指定目标逻辑参数对象');
    }
    return value;
  }

  protected dstpsdataentity: IPSDataEntity | null = null;

  getDstPSDataEntity(): IPSDataEntity | null {
    if (this.dstpsdataentity != null) return this.dstpsdataentity;
    const value = this.M.getDstPSDataEntity;
    if (value == null) {
      return null;
    }
    this.dstpsdataentity = this.getPSModel4('dataentity.IPSDataEntity', value, 'getDstPSDataEntity') as IPSDataEntity;
    return this.dstpsdataentity;
  }

  get dstPSDataEntity(): IPSDataEntity | null {
    return this.getDstPSDataEntity();
  }

  getDstPSDataEntityMust(): IPSDataEntity {
    const value = this.getDstPSDataEntity();
    if (value == null) {
      throw new Error('未指定目标实体对象');
    }
    return value;
  }

  get param1(): string {
    return this.M.param1;
  }

  get param10(): number {
    return this.M.param10;
  }

  get param11(): string {
    return this.M.param11;
  }

  get param12(): string {
    return this.M.param12;
  }

  get param13(): string {
    return this.M.param13;
  }

  get param14(): string {
    return this.M.param14;
  }

  get param2(): string {
    return this.M.param2;
  }

  get param3(): string {
    return this.M.param3;
  }

  get param4(): string {
    return this.M.param4;
  }

  get param5(): string {
    return this.M.param5;
  }

  get param6(): string {
    return this.M.param6;
  }

  get param7(): number {
    return this.M.param7;
  }

  get param8(): number {
    return this.M.param8;
  }

  get param9(): number {
    return this.M.param9;
  }

  protected retpsdelogicparam: IPSDELogicParam | null = null;

  getRetPSDELogicParam(): IPSDELogicParam | null {
    if (this.retpsdelogicparam != null) return this.retpsdelogicparam;
    const value = this.M.getRetPSDELogicParam;
    if (value == null) {
      return null;
    }
    const ipsdelogic = this.getParentPSModelObject('dataentity.logic.IPSDELogic') as IPSDELogic;
    if (ipsdelogic != null) {
      this.retpsdelogicparam = ipsdelogic.findPSDELogicParam(value);
    }
    return this.retpsdelogicparam;
  }

  get retPSDELogicParam(): IPSDELogicParam | null {
    return this.getRetPSDELogicParam();
  }

  getRetPSDELogicParamMust(): IPSDELogicParam {
    const value = this.getRetPSDELogicParam();
    if (value == null) {
      throw new Error('未指定返回值绑定逻辑参数对象');
    }
    return value;
  }

  get cls(): string {
    return 'PSDEUserLogicImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'dataentity.logic.IPSDEUserLogic') return true;
    return super.instanceof(cls);
  }
}
